package com.kfit.config;

import org.springframework.security.crypto.password.PasswordEncoder;

public class MD5PasswordEncoder implements PasswordEncoder{

	@Override
	public String encode(CharSequence rawPassword) {
		//rawPassword : 用户输入的密码 = 原始密码： 123456
		return MD5Util.encode((String)rawPassword);
	}

	@Override
	public boolean matches(CharSequence rawPassword, String encodedPassword) {
		return encodedPassword.equals(MD5Util.encode((String)rawPassword));
	}
	
}
